<!--
 * @Author: nns4
 * @Date: 2020-12-11 10:33:17
 * @LastEditors: nns4
 * @FilePath: /studyNote/vue/src/views/test/sendInfo/prop/component/son.vue
 * @Description: prop子组件
-->
<template>
    <div class="son">
        <input type="text" v-model="子组件说"> <button @click="对父组件说()">对父组件说</button>
        <p>父组件对我说--{{子组件prop}}</p>
    </div>
</template>

<script>
    export default {
        props: ['子组件prop'],
        data() {
            return {

                父组件说: "",
                子组件说: ""
            }
        },
        methods: {
            对父组件说() {
                this.$emit('子组件emit', this.子组件说)
                // this.子组件prop.say="prop引用类型可以改，prop基础类型不能改"
            }
        }

    }
</script>

<style lang="less" scoped>
    .son {
        border: 1px solid red;
        height: 100px;
    }
</style>